package com.wangpu.oa.service;

import java.util.HashMap;
import java.util.Map;

import com.wangpu.oa.service.impl.SystemServiceImpl;
import com.wangpu.oa.service.impl.UserServiceImpl;

public class ServiceFactory {
private static final Map<Class,Object> SERVICE_MAP=new HashMap<>();
	
	static {
		SERVICE_MAP.put(UserService.class, new UserServiceImpl());
		SERVICE_MAP.put(RoleService.class, new SystemServiceImpl());
	}
	
	public static <T>T getService(Class<T> type){
		return (T)SERVICE_MAP.get(type);
	}
}
